home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
msqc25t1
/
scrnio.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-09-27
|
2KB
|
65 lines
/* scrnio.c: demos screen management functions */
#include <graph.h>
#include <conio.h>
main()
{
int row, col, p;
int oldcolor = 1;
char str [80];
struct rccoord textpos;
struct videoconfig display;
_clearscreen (0);
_settextposition (1, 31); /* center following text */
_outtext("SCREEN MANAGEMENT");
for (row = 2; row < 17; row++) { /* write some text */
col = row;
_settextcolor (oldcolor++); /* next color */
_settextposition (row, col);
sprintf (str, "This begins in column %2d, row %2d", col, row);
_outtext (str);
}
textpos = _gettextposition(); /* get cursor location */
_settextposition (19, 1);
_settextcolor (7);
sprintf (str, "At end of last row, cursor was at row %d, col %d",
textpos.row, textpos.col);
_outtext (str);
_outtext ("\nPress any key to erase row numbers...");
getch(); /* wait for signal */
for (row =2; row < 17; row++) {
col = row + 24;
_settextposition (row, col);
for (p = col; p < col+12; p++)
putch (' '); /* erase col part of each line */
}
_settextposition (21, 1);
_outtext ("Press any key to turn off cursor...");
getch(); /* wait */
_displaycursor (_GCURSOROFF); /* shut off cursor */
_outtext ("\nPress any key to turn cursor back on...");
getch(); /* wait */
_displaycursor (_GCURSORON); /* cursor back on */
_outtext ("\nPress any key to see your video configuation...");
getch();
_getvideoconfig (&display); /* get video config */
_clearscreen (0); /* new screen */
_outtext ("Text video configuration:");
sprintf (str, "\n Columns %3d",display.numtextcols);
_outtext (str);
sprintf (str, "\n Rows %3d",display.numtextrows);
_outtext (str);
sprintf (str, "\n Video pages available %3d",display.numvideopages);
_outtext (str);
}